
import  React, { Component } from 'react';
import {InputNumber } from 'antd';
import  Good from './Good';
class  Good_Cart   extends   Component{
    static defaultProps={






    }

    constructor(props) {
        super()
        this.state = {
            allmoney:0

        }


       this.getallmoney=this.getallmoney.bind(this)


    }



    getallmoney(val){
           this.setState({  allmoney:this.state.allmoney+val   },()=>{ console.log(this.state.allmoney)   })
          console.log(val);





    }


    componentDidMount(){









    }
    componentWillUpdate(){




    }
    render() {


        return(
            <div>

                <Good  money={ 10 }   mount={ 0 }   son={ this.getallmoney  }    />
                <Good  money={ 50 }   mount={ 0 }   son={  this.getallmoney  }     />
                <Good  money={ 20 } son={  this.getallmoney  }    />
                  总价： {  this.state.allmoney   }


            </div>

        );


    }



}

export default  Good_Cart;